#include "stdafx.h"
#include "StateMachine.h"
#include "BaseGameComponent.h"

StateMachine::StateMachine(void)
{

}

StateMachine::~StateMachine(void)
{
	if (currentState)
		currentState->Release();
}

void StateMachine::setCurrentState(BaseGameComponent* value)
{
	value->AddRef();
	if (currentState)
		currentState->Release();
	currentState = value;
}